<?php
require_once("../inc/bootstrap.php");

/* Get the filename of an uploaded file.
   Parameter: id=post ID
   Return value: the filename.
*/

$ID = intval($_GET['id']);
$mysqli = dbconnect();
$query = "SELECT filename,filesize FROM uploads WHERE id=?";
$statement = $mysqli->stmt_init();
$statement->prepare($query);
$statement->bind_param("i", $ID);
$statement->execute();
if ($statement->num_rows == 1)
{
echo dbresult($statement,0,0);
}
}
?>